var axios = require('axios');

axios.default.defaults.baseURL = "http://192.168.50.41:8080/";

var GetFlight = function (Min, Max) {
    var Rand = Math.floor(Math.random() * Max) + Min;
    var Url = '/api/flight/' + Rand;
    return axios.default.get(Url)
        .then(function (response) {
            console.log(response);
            return response.data;
        })
        .catch(function (err) {
            console.log(err);
        });
};

export {GetFlight};